# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Jeff Bilyk <jbilyk at gmail>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-dbd-mysql
_pkgname=DBD-mysql
pkgver=4.050
pkgrel=5
pkgdesc="Perl CPAN DBD::Mysql module"
url="http://search.cpan.org/~capttofu/DBD-mysql/"
arch="all"
license="GPL PerlArtistic"
depends="perl perl-dbi"
makedepends="perl perl-dev mariadb-connector-c-dev zlib-dev perl-devel-checklib"
source="https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-$pkgver.tar.gz"
subpackages="$pkgname-doc"
options="!check" # requires a running dbms
builddir="$srcdir"/${_pkgname}-$pkgver

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	find "$pkgdir" -name perllocal.pod -delete
}

check() {
	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

sha512sums="910f5b4ba7a7890d50a79f37d04ec8971a4f62acd0fe30bf3ab634f66e3128f0cd6513e5c9da8c807a0f4477d0cc766682ea8dd0d8072d02821b78df51f37879  DBD-mysql-4.050.tar.gz"
